<script setup lang="ts">
import { reactive } from "vue";

const person = reactive({
    name: '张三',
    age: 18,
    hobby:['打篮球','踢足球']
})
const changeAge = () => { 
    person.age++
}
const AddHobby = () => { 
    person.hobby.push('打游戏')
}
</script>
<template>
    <button @click="changeAge">加分</button>
    <div>年龄：{{ person.age }}</div>
    <div>兴趣爱好：{{ person.hobby }}</div>
    <button @click="AddHobby">增加兴趣爱好</button>
</template>

